package com.gongfutrip.trans.client.exception;

public class ClientException extends Exception {
  private static final long serialVersionUID = -5758410930844185841L;
  private String errorMessage;
  private int code;

  public ClientException(String errorMessage, Throwable cause) {
    super(errorMessage, cause);
    this.errorMessage = errorMessage;
  }

  public ClientException(String errorMessage) {
    super("DESC: " + errorMessage);
    this.errorMessage = errorMessage;
  }

  public ClientException(int responseCode, String errorMessage) {
    super("CODE: " + responseCode + "  DESC: " + errorMessage);
    this.code = responseCode;
    this.errorMessage = errorMessage;
  }


  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }

  public String getErrorMessage() {
    return errorMessage;
  }

  public void setErrorMessage(final String errorMessage) {
    this.errorMessage = errorMessage;
  }
}
